import request from '@/utils/request'

export function Login(data) {
  return request({
    url: '/users/login',
    method: 'post',
    data
  })
}

export function Register(data) {
  return request({
    url: '/users/register',
    method: 'post',
    data
  })
}

export function uploadAvatar(data) {
  return request({
    url: '/users/upload',
    method: 'post',
    data
  })
}

export function updateInfo(id, data) {
  return request({
    url: `/users/myInfo/${id}`,
    method: 'patch',
    data
  })
}

export function changePassword(id, data) {
  return request({
    url: `/users/changePassword/${id}`,
    method: 'patch',
    data
  })
}